package dongshi.daddy.main;

import dongshi.daddy.service.MyStubService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConsumerWithStubMain {
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context
                = new ClassPathXmlApplicationContext("consumer-with-sub.xml");
        context.start();
        MyStubService myStubService = (MyStubService) context.getBean("myStubServiceInConsumerSide");
        // 调用服务提供者
        System.out.println(myStubService.stubSayHello("hello"));
        // 不会调用服务提供者
        System.out.println(myStubService.stubSayHello("111"));
        System.in.read();
    }
}
